#include <bits/stdc++.h>

#define eb emplace_back
#define ep emplace
#define fi first
#define se second
#define in read<int>()
#define lin read<ll>()
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using ll = long long;
using db = double;
using pii = pair < int, int >;
using vec = vector < int >;
using veg = vector < pii >;

template < typename T > T read() {
	T x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-', ch = getchar();
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = getchar();
	return f ? -x : x;
}

template < typename T > void chkmax(T &x, const T &y) { x = x > y ? x : y; }
template < typename T > void chkmin(T &x, const T &y) { x = x < y ? x : y; }

const int N = 1e6 + 10;

char s[N];
int n;

#define OK puts("Yes")
#define NO puts("No")

int main() {
#ifndef ONLINE_JUDGE
	freopen("1.in", "r", stdin);
#endif
	scanf("%s", s + 1); n = strlen(s + 1);
	int prea = n, sufa = n;
	rep(i, 1, n) if(s[i] != 'a') { prea = i - 1; break; }
	per(i, n, 1) if(s[i] != 'a') { sufa = n - i; break; }
	//	cerr << prea << " " << sufa << endl;
	if(prea == sufa && prea == n) OK;
	else if(prea > sufa) NO;
	else {
		string t;
		rep(i, prea + 1, n - sufa) {
			t += s[i];
		}
		string v = t; reverse(v.begin(), v.end());
		if(v == t) OK;
		else NO;
	}
	return 0;
}
